package com.codeforces.edu98;

import java.util.Arrays;
import java.util.Scanner;

public class B {
    Scanner in = new Scanner(System.in);
    void solve(){
        int t;
        t = in.nextInt();
        while(t-- > 0){
            int n = in.nextInt();
            int[] arr = new int[n];
            long sum = 0;
            int max = -1;
            for(int i = 0;i < n;i++){
                int temp = in.nextInt();
                arr[i] = temp;
                sum += temp;
                max = Math.max(max,temp);
            }
            Arrays.sort(arr);
            for(long add = (int)(sum % (n - 1));add <= sum;add += n - 1){
                boolean flag = true;
                long diff = 0;
                for(int i = 0;i < arr.length;i++){
                    for(int j = 0;j < arr.length;j++){
                        if(i != j){
                            diff += max - arr[j];
                        }
                    }
                    if(diff > arr[i] + add){
                        flag = false;
                        break;
                    }
                }
                if(flag){
                    System.out.println(add);
                    break;
                }

            }

        }
    }


    public static void main(String[] args) {
        B s = new B();
        s.solve();
    }
}
